Image processing apparatus and method of controlling image processing apparatus

ABSTRACT

An image processing apparatus comprising: a first obtaining unit configured to obtain a focal length of an imaging optical system; a second obtaining unit configured to obtain a distance to a subject; a setting unit configured to set a movable range for a correction unit configured to correct camera shake, based on the focal length and the distance to a subject; and a calculation unit configured to calculate a correction amount for correcting the camera shake within the movable range that was set by the setting unit, based on a camera shake signal from a camera shake detection unit configured to detect camera shake and output the camera shake signal.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of application Ser. No. 14/831,545,filed Aug. 20, 2015, the entire disclosure of which is herebyincorporated by reference.

BACKGROUND OF THE INVENTION Field of the Invention

The present invention relates to an image processing apparatus and amethod of controlling an image processing apparatus.

Description of the Related Art

Generally, in an image capturing apparatus such as a digital camera,shaking of the actual image capturing apparatus is detected, and imageblur caused by this camera shake is corrected. When this correction isperformed, a movable lens member (an image stabilization lens and aholding member for the same) that can be shifted is driven by an imagestabilization apparatus so as to correct the image blur.

Also, there are many cases in which an angular velocity meter and anaccelerometer are used when detecting camera shake in the imagestabilization apparatus. For example, an image stabilization device thatdetects angular shake using an angular velocity meter and suppressesimage blur by moving a portion of imaging lenses or an image sensor isbuilt into various optical instruments. However, in close rangeshooting, it is not possible to ignore image degradation caused byvibration that cannot be detected by the angular velocity meter alone,in other words so-called translational shake acting in the horizontaldirection or the vertical direction in a plane orthogonal to the opticalaxis of the camera. For example, in the case of macro imaging in whichthe camera is approximately 20 cm away from a subject, there is a needto proactively detect and correct the translational shake. Anaccelerometer is often used to detect this translational shake.

The image stabilization apparatus obtains a camera shake amount anddirection from obtained angular velocity information and accelerationinformation, and outputs a correction position control signal fordriving the movable lens member so as to cancel out the image blur. Whenthe movable lens member is driven, the current position of the movablelens member is fed back to the image stabilization apparatus as amovable member position signal. Then, the image stabilization apparatusperforms feedback control to output a correction position control signalthat corresponds to the movable member position signal.

Also, an image stabilization device and an image capturing apparatushave been proposed with which power saving can be achieved by activatingand stopping image stabilization in accordance with the focal length andthe distance to a subject (imaging magnification) when a subject imageis displayed as a moving image on an LCD (see Japanese Patent Laid-OpenNo. 2013-104921). With a digital camera, a moving image can be displayedon the screen of an LCD or the like, but there are cases in which evenif camera shake influences the recorded subject image, it will notinfluence the subject image displayed as a moving image, that is to saythe user will not perceive the image blur. In the case in which imagestabilization is also executed during moving image display, imagestabilization is executed even if the camera shake has no influence onthe moving image during wide angle shooting, and thus power iswastefully consumed.

In view of this, in Japanese Patent Laid-Open No. 2013-104921, controlsuch as the following is proposed for the period in which a moving imagesensed on a wide angle side with a short focal length is beingdisplayed. Specifically, it is determined whether or not thedisplacement amount of the subject image for display due to camera shakeexceeds the pixel pitch of the display screen, and in the case in whichthe user cannot perceive image blur in the subject image for display, orin the case in which the user is not bothered by the image blur verymuch, either the degree of stabilization operation of the imagestabilization mechanism is reduced or an operation stop state isentered. On the other hand, in the case in which the user can perceiveimage blur of the subject image for display, the image stabilizationmechanism is activated, and the degree of stabilization operation isincreased. Also, as explained before, when the subject is at a closerange and the magnification ratio is high as in macro imaging, theinfluence of the angular shake and the translational shake increases,and thus even in wide angle shooting, the image stabilization mechanismis made active in accordance with the distance to the subject in orderto raise the suppression effect.

Also, in image data obtained by an image capturing apparatus, there isgenerally a tendency for the margins, including the four corners, to bedarker than the center. Particularly, the phenomenon in which the amountof light in the margins decreases relative to the center is called“shading”. The larger the decreasing rate of the amount of light in themargin portion relative to the center (marginal illumination) is, theworse the image data quality becomes. A decrease in the marginalillumination is an intrinsic characteristic of the lenses, and for thisreason it can be said to be the characteristic that causes variance inthe luminance in the four corners. The decreasing rate of the marginalillumination changes in accordance with the zoom magnification rate,that is to say the zoom lens position as well. Furthermore, when theimage stabilization lens shifts from the optical axis, the amount oflight in the region on the side opposite to the shifted directiondecreases, and attachment position error of the image sensor and thelike is also a factor in the decrease in the amount of light. There hasbeen a need to determine a movable range for a correction lens so thatshading does not have an influence on images to be displayed orrecorded, taking into consideration all of these factors in the decreasein the amount of light.

Furthermore, depending on the arrangement of an optical lens group,there are cases in which the amount of light also decreases due to theposition of the focus lens that performs focus adjustment. For example,if the mechanism of the focus lens group is an inner focus type, thereare cases in which the effective focal length decreases due to shiftingthe position of the focus lens to the front lens side for the purpose ofbeing in focus when performing macro-imaging at close range, and thusthe marginal illumination decreases.

For this reason, in the case of determining the movable range of thecorrection lens at each zoom lens position as described in JapanesePatent Laid-Open No. 2013-104921, there has been an issue in which adecrease in marginal illumination becomes noticeable when performingmacro imaging, depending on the arrangement of the optical lens group.Also, if the movable range is set according to the movable range whenperforming macro-imaging, there has been an issue in which the movablerange in a normal shooting range becomes narrow, and a sufficientcorrection effect cannot be obtained for large camera shakes such asthose that occur when shooting while walking.

SUMMARY OF THE INVENTION

The present invention has been made in consideration of the abovesituation, and prevents significant deterioration in image qualitycaused by shading, while also utilizing an image stabilization effect.

According to the present invention, provided is an image processingapparatus comprising: a first obtaining unit configured to obtain afocal length of an imaging optical system; a second obtaining unitconfigured to obtain a distance to a subject; a setting unit configuredto set a movable range for a correction unit configured to correctcamera shake, based on the focal length and the distance to a subject;and a calculation unit configured to calculate a correction amount forcorrecting the camera shake within the movable range that was set by thesetting unit, based on a camera shake signal from a camera shakedetection unit configured to detect camera shake and output the camerashake signal.

Further, according to the present invention, provided is an imageprocessing apparatus comprising: an obtaining unit configured to obtaina distance to a subject; a determination unit configured to determinewhether or not macro imaging is being performed based on the distance toa subject; a setting unit configured to, in a case in which the macroimaging is being performed, set a movable range of a correction unitthat corrects camera shake narrower than in a case in which themacro-imaging is not being performed; and a calculation unit configuredto calculate a correction amount for correcting the camera shake withinthe movable range that was set by the setting unit, based on a camerashake signal from a camera shake detection unit configured to detectcamera shake and output the camera shake signal.

Furthermore, according to the present invention, provided is a method ofcontrolling an image processing apparatus, comprising: a first obtainingstep of obtaining a focal length of an imaging optical system; a secondobtaining step of obtaining a distance to a subject; a setting step ofsetting a movable range for a correction unit that corrects camerashake, based on the focal length and the distance to a subject; and acalculation step of calculating a correction amount for correcting thecamera shake within the movable range that was set in the setting step,based on a camera shake signal from a camera shake detection unitconfigured to detect camera shake and output the camera shake signal.

Further, according to the present invention, provided is a method ofcontrolling an image processing apparatus, comprising: an obtaining stepof obtaining a distance to a subject; a determination step ofdetermining whether or not macro imaging is being performed based on thedistance to a subject; a setting step of, in a case in which the macroimaging is being performed, setting a movable range of a correction unitthat corrects camera shake narrower than in a case in which themacro-imaging is not being performed; and a calculation step ofcalculating a correction amount for correcting the camera shake withinthe movable range that was set in the setting step, based on a camerashake signal from a camera shake detection unit configured to detectcamera shake and output the camera shake signal.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments (with reference to theattached drawings).

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of the specification, illustrate embodiments of the invention, andtogether with the description, serve to explain the principles of theinvention.

FIG. 1 is a block diagram of an image capturing apparatus according toan embodiment of the present invention;

FIG. 2 is a diagram showing marginal illumination relative to camerashake correction angle of a correction lens according to the embodiment;

FIG. 3 is a diagram showing a relation between movement of thecorrection lens and a position of a drop in an amount of light accordingto the embodiment;

FIG. 4 is a diagram showing a relation between a distance to a subjectand a movable range of a correction lens according to the embodiment;and

FIG. 5 is a flowchart showing a procedure for setting the movable rangeof the correction lens according to the embodiment.

DESCRIPTION OF THE EMBODIMENTS

Exemplary embodiments of the present invention will be described indetail in accordance with the accompanying drawings.

FIG. 1 is a block diagram showing a functional configuration example ofan image capturing apparatus according to an embodiment of the presentinvention. In the present embodiment, the image capturing apparatus isassumed to be a digital still camera, but it may also have a movingimage shooting function.

In FIG. 1, a zoom unit 101 is a portion of the imaging lens thatconstitutes the imaging optical system, and includes a zoom lens thatchanges lens magnification. A zoom driving control unit 102 controlsdriving of the zoom unit 101 in accordance with control by a camerasystem control unit 118. A correction lens 103 is configured so as to beable to shift in a direction orthogonal to the optical axis of theimaging lens, and the driving thereof is controlled by an imagestabilization control unit 104. Note that the image stabilizationcontrol unit 104 includes an angular velocity sensor that detectsangular shake that occurs in the image capturing apparatus and anacceleration sensor that detects translational shake in a plane that isorthogonal to the optical axis.

An aperture/shutter unit 105 is a mechanical shutter that has anaperture function. An aperture/shutter driving control unit 106 drivesthe aperture/shutter unit 105 in accordance with control by the camerasystem control unit 118. A focus lens 107 is a portion of the imaginglens and is configured to be able to change its position along theoptical axis of the imaging lens. A focus driving control unit 108drives the focus lens 107 in accordance with control by the camerasystem control unit 118. In the present embodiment, the focus lens 107has an inner focus type arrangement.

An image sensing unit 109 converts an optical image that has entered viathe imaging lens into an electric signal in units of pixels using animage sensor such as a CCD image sensor or a CMOS image sensor. An imagesignal processing unit 110 performs A/D conversion, correlated doublesampling, gamma correction, white balance correction, colorinterpolation processing, and the like on the electric signal outputfrom the image sensing unit 109, and converts the electric signal into avideo signal. A video signal processing unit 111 manipulates the videosignal output from the image signal processing unit 110 in accordancewith the application. Specifically, the video signal processing unit 111generates video for display, and performs encoding processing forrecording or data filing.

A display unit 112 performs image display as necessary based on thevideo signal for display that the video signal processing unit 111outputs. A power unit 113 supplies power to the entire image capturingapparatus in accordance with the application. An external input/outputterminal unit 114 performs input and output of communication signals andvideo signals with an external apparatus. A storage unit 116 storesvarious data such as video information. An orientation detection unit117 detects the orientation of the image capturing apparatus, andprovides orientation information to the video signal processing unit 111and the display unit 112. A video signal from the video signalprocessing unit 111 is determined as being vertically long orhorizontally long by the orientation information from the orientationdetection unit 117, and an image display direction on the display unit112 is determined. The camera system control unit 118 has a CPU, a ROM,and a RAM for example, and by deploying a control program stored on theROM to the RAM and executing it with the CPU, portions of the imagecapturing apparatus are controlled, and various image capturingapparatus operations including the following are realized.

An operation unit 115 has buttons and switches and the like for a userto give instructions to the image capturing apparatus, and includes arelease button configured so that a first switch (SW1) and a secondswitch (SW2) are successively turned ON in accordance with the amountthe release button is pressed. When the release button is pressed downapproximately half way, the release switch SW1 is turned ON, and whenfully pressed down, the release switch SW2 is turned ON. When therelease switch SW1 is turned ON, the camera system control unit 118performs automatic focus detection by controlling the focus drivingcontrol unit 108 based on an AF evaluation value calculated based on thevideo signal for display output by the video signal processing unit 111to the display unit 112, for example. Also, the camera system controlunit 118 performs AE processing that determines an aperture value and ashutter speed for obtaining an appropriate amount of exposure based onthe luminance information of the video signal and, for example, apredetermined program diagram.

When the release switch SW2 is turned ON, the camera system control unit118 performs imaging with the determined diaphragm value and shutterspeed and controls each unit so that image data obtained by the imagesensing unit 109 is stored in the storage unit 116. Also, when a throughimage is to be displayed in a state in which the release switch has notbeen pressed, the camera system control unit 118 performs preliminarydetermination of the diaphragm value and the shutter speed at apredetermined interval, based on the aforementioned luminanceinformation of the video signal and the program line diagram inpreparation for still image shooting.

An image stabilization switch for selecting an image stabilization modeis included in the operation unit 115. When the image stabilization modeis selected by the image stabilization switch, the camera system controlunit 118 instructs the image stabilization control unit 104 to performan image stabilization operation, and the image stabilization controlunit 104 that receives this instruction performs the image stabilizationoperation until an image stabilization OFF instruction is given. Also,an imaging mode selection switch that allows for selection between astill image shooting mode and a moving image shooting mode is includedin the operation unit 115, and image shooting is performed with imagingconditions that are appropriate to the selected imaging mode.

Also, a playback mode selection switch for selecting a playback mode isincluded in the operation unit 115, and the image stabilizationoperation is stopped when in the playback mode. Furthermore, amagnification change switch that gives a magnification changeinstruction is included in the operation unit 115. When a zoommagnification change instruction is given by the magnification changeswitch, the zoom driving control unit 102 that receives the instructionvia the camera system control unit 118 drives the zoom unit 101 so as toshift the zoom unit 101 to the instructed zoom position.

Next described is a detailed description of the position of thecorrection lens 103, the drop in the amount of light in the regionpositioned farthest from the optical axis, that is to say the fourcorners, and the movable range of the correction lens 103. FIG. 2 is adiagram showing the marginal illumination relative to the camera shakecorrection angle from the center of the optical axis of the correctionlens 103 in the case in which the zoom lens is at the wide end. Notethat out of the four corners, FIG. 2 shows marginal illumination at acorner located in the direction opposite to the direction of movement ofthe angle of view as shown in FIG. 3 when the correction lens 103 ismoved.

As shown in FIG. 2, letting the marginal illumination be 1 in the casein which the correction lens 103 is at the center of the optical axis,when the position of the correction lens 103 is moved away from thecenter of the optical axis, the amount of light drops as the distanceincreases. A shading state in which the decreasing rate of the marginalillumination is greater than a predetermined decreasing rate cannot beallowed in view of image quality, and therefore the movable range of thecorrection lens 103 is set such that the decreasing rate of the marginalillumination does not exceed a predetermined decreasing rate. In thepresent embodiment, the movable range of the correction lens 103 is setsuch that the decreasing rate of the amount of light does not exceed0.5.

Here, when the decreasing rate of the marginal illumination is comparedusing a graph 201 for the case in which the distance to a subject is inthe normal imaging region and a graph 202 for the case of imaging in amacro imaging region, the decreasing rate of the marginal illuminationfor the macro imaging region is greater at the same distance from thecenter of the optical axis. This is because in the case in which thefocus arrangement is an inner focus type, when the focus lens is broughtto the front during macro-imaging, the effective focal length of theoverall lens system becomes short, and the spreading of the lightbecomes larger.

In the example of the present embodiment, the movable range of thecorrection lens 103 according to which the decreasing rate of themarginal illumination is 0.5, which is half of that in the case in whichthe correction lens 103 is at the center of the optical axis, is 2.5degrees in the normal imaging region and 1.5 degrees in the macroimaging region.

Next, the relation between the distance to a subject and the movablerange of the correction lens 103 in a case in which the zoom lens is atthe wide angle end will be described using FIG. 4. In FIG. 4, the dashedline shows an example in which the movable range of the correction lens103 is not changed according to the distance to a subject information,but rather is fixed to the movable range in the case in which thedistance to a subject is in the macro imaging region which is moststrongly influenced by shading. In the example shown by the dashed line,the movable range is fixed in the macro imaging region in which the dropin the amount of light is large, and therefore in the case in which thedistance to a subject is in the normal imaging region, a range that isnarrower than the actually allowed movable range is set, and the imagestabilization effect on large camera shaking such as imaging whenwalking, decreases.

In contrast, the solid line shows an example of the case of changing themovable range of the correction lens 103 taking into consideration theinfluence of shading according to the distance to a subject information.

In this way, in the present embodiment, a movable range setting tablethat corresponds to the distance to a subject shown by solid lines forevery zoom lens position is prepared, and the movable range is changedevery time the zoom lens position and/or the distance to a subjectchanges. Note that with this method, the movable range is frequentlychanged, and a large amount of memory is used to store the movable rangefor each zoom lens position and each distance to a subject. For thisreason, a configuration is possible in which the distance to a subjectis compared with a predetermined threshold value, and it is determinedwhether the distance to a subject is in the macro imaging region or thenormal imaging region, and the movable range is set narrow only when inthe macro imaging region (dashed line). By doing this, there is no needto prepare a movable range table value for every distance to a subject,and the amount of used memory can be reduced. Note that theaforementioned threshold value may be changed for every zoom lensposition, or the same value may be used regardless of the zoom lensposition.

In this way, a movable range taking into consideration the influence ofshading can be set by setting the movable range of the correction lens103 according to the distance to a subject information, in addition tothe zoom lens position information.

Next, as an example of changing the movable range of the correction lens103 in the present embodiment, the following is a detailed descriptionof the case in which the movable range is changed depending on whetherthe distance to a subject is in the macro imaging region or the normalimaging region at the aforementioned zoom lens position. FIG. 5 isflowchart showing processing for setting the movable range of thecorrection lens 103.

First, when the image stabilization mode is selected in the operationunit 115, and the image stabilization operation is put in the ON state,whether or not the zoom lens position has changed is checked in stepS101. Here, the current zoom lens position is compared with thecurrently held zoom lens position information, and if the zoom lensposition has changed, then the procedure moves step S102, the currentzoom lens position is stored, and the procedure moves to step S103. Thefocal length information can also be obtained from the zoom lensposition information, but this focal length is a value for when thedistance to a subject is an infinite distance. On the other hand, if thezoom lens position has not changed in step S101, the zoom lens positioninformation is not updated, and the procedure moves to step S103.

The distance to a subject information is obtained in step S103, and itis determined whether the distance to a subject is in the macro imagingregion or the normal imaging region based on the distance to a subjectinformation. For example, assume that the distance to a subject is inthe macro imaging region if the distance to a subject is 50 cm or less(less than or equal to a threshold value). Note that the determinationmay be performed using imaging magnification information obtained fromthe zoom lens position and the distance to a subject information,instead of the distance to a subject information, or using the focuslens position information at the time when an in-focus state is achievedby driving the focus lens 107.

If it is determined in step S103 that the distance to a subject is notin the macro imaging region (that is to say, is in the normal imagingregion), the procedure moves to step S106, and the movable range for thenormal imaging region is set. As an example, in the case of the wideend, 2.5 degrees is set. Then in step S107, there is a switch to imagestabilization control that prioritizes angular shake correction. In thenormal imaging region, the shift (translational) shake amount is small,and therefore almost all of the correction amount is an angular shakecorrection amount. Note that in the case in which a large shake occurssuch as in imaging when walking, if a correction amount that is thetotal of the shift shake correction amount and the angular shakecorrection amount exceeds the movable range, these correction amountsare changed such that the total correction amount falls within themovable range while maintaining the ratio between the shift shakecorrection amount and the angular shake correction amount. In the casein which the total correction amount does not exceed the movable range,the unchanged correction amounts are used. On the other hand, forexample if the angular shake correction amount is 3.0 degrees, and theshift shake correction amount is 0.3, the total correction amount is 3.3degrees, and in the case in which the movable range is 2.5 degrees, thecorrection amounts are restricted while maintaining the ratio of3.0:0.3. In this case, the angular shake correction amount is 2.27degrees, the shift shake correction amount is 0.23 degrees, and thetotal correction amount is 2.5 degrees. Alternatively, the angular shakecorrection amount may be increased such that the correction ratiobetween the acceleration correction amount and the shift shakecorrection amount is 3:2.

On the other hand, if it is determined in step S103 that the distance toa subject is in the macro imaging region, the movable range of thecorrection lens 103 is set to the movable range for the macro imagingregion (step S104). For example, assume that the movable range is 1.5degrees in the case of the wide angle end. Then there is a switch toimage stabilization control that prioritizes shift shake correction(step S105). The shift shake correction prioritization control hererefers to a higher proportion for the shift shake correction amount whenthe correction amounts are limited in the case in which the total valueof the angular shake correction amount and the shift shake correctionamount exceeds the movable range. When performing macro imaging, imagingin which large angular shake occurs such as when imaging while walkingis not often performed, and it is often the case that the user holds thecamera steadily to a certain extent during imaging, and therefore moreimage stabilization is performed for shift shake which is more likely tooccur than angular shake in macro imaging.

For example, in the case of the angular shake correction amount being1.0 degrees and the shift shake correction amount being 1.0 degrees, thetotal correction amount is 2.0 degrees. In this way, in the case inwhich the movable range amount is exceeded, the angular shift correctionamount is set to 0.6 degrees and the shift shake correction amount isset to 0.9 degrees (the ratio between the angular shake correctionamount and the shift shake correction amount is 2:3) to enhance theshift shake correction effect in the macro imaging region. Also,similarly, if the total correction amount does not exceed 1.5 degrees,image stabilization is performed using the angular shake correctionamount and the shift shake correction amount as is.

Next, in step S108, it is determined whether or not the imagestabilization operation is set to OFF, and if the image stabilizationoperation is still ON, then the procedure returns to step S101, andimage stabilization is continued, whereas the image stabilization isended when the image stabilization is set to OFF.

According to the present invention as described above, an optimummovable range that is appropriate for the shading characteristics of theoptical system can be set by changing the movable range of thecorrection lens 103 according to the zoom lens position and the distanceto a subject. Accordingly, significant deterioration in image qualitydue to shading can be prevented, while also utilizing the imagestabilization effect.

Although a favorable embodiment of the present invention has beendescribed above, the present invention is not limited to theabove-described embodiment. For example, in the case in which imagestabilization is performed by driving the image sensor according to thecamera shake amount, or in the case in which electronic imagestabilization is performed by changing the cropping position accordingto the camera shake amount, etc., a similar technique can be applied,and various variations and modifications are possible within the scopeof the gist of the invention.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2014-170890, filed Aug. 25, 2014 which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. An image processing apparatus comprising: one ormore processors programmed to perform operations of following units: afirst obtaining unit configured to obtain a focal length of an imagingoptical system; a second obtaining unit configured to obtain a distanceto a subject; a setting unit configured to set a movable range for acorrection unit configured to correct camera shake, based on the focallength and the distance to a subject; and a calculation unit configuredto calculate a correction amount for correcting the camera shake withinthe movable range that was set by the setting unit, based on a camerashake signal from a camera shake sensor configured to detect camerashake and output the camera shake signal, wherein the setting unit setsthe movable range such that, in a case where the distance to a subjectis less than or equal to a predetermined threshold value, the movablerange continuously becomes narrower as the distance to a subject becomesshorter.
 2. The image processing apparatus according to claim 1, whereinin a case where the distance to a subject is greater than apredetermined threshold value, the setting unit fixes the movable range.3. The image processing apparatus according to claim 1, wherein in acase where the distance to a subject is less than or equal to apredetermined threshold value, the setting unit determines that thedistance to a subject is in a macro imaging region.
 4. The imageprocessing apparatus according to claim 3, wherein in a case where thedistance to a subject is in the macro imaging region and a total valueof an angular shake correction amount and a shift shake correctionamount which constitute the correction amount exceeds the movable range,the setting unit set a ratio of the shift shake correction amount largerthan in a case where the total value does not exceeds the movable range.5. An image capturing apparatus comprising: an image sensor; and animage processing apparatus comprising one or more processors programmedto perform operations of following units: a first obtaining unitconfigured to obtain a focal length of an imaging optical system; asecond obtaining unit configured to obtain a distance to a subject; asetting unit configured to set a movable range for a correction unitconfigured to correct camera shake, based on the focal length and thedistance to a subject; and a calculation unit configured to calculate acorrection amount for correcting the camera shake within the movablerange that was set by the setting unit, based on a camera shake signalfrom a camera shake sensor configured to detect camera shake and outputthe camera shake signal, wherein the setting unit sets the movable rangesuch that, in a case where the distance to a subject is less than orequal to a predetermined threshold value, the movable range continuouslybecomes narrower as the distance to a subject becomes shorter.
 6. Amethod of controlling an image processing apparatus comprising:obtaining a focal length of an imaging optical system; obtaining adistance to a subject; setting a movable range for a correction unitconfigured to correct camera shake, based on the focal length and thedistance to a subject; and calculating a correction amount forcorrecting the camera shake within the set movable range, based on acamera shake signal from a camera shake sensor configured to detectcamera shake and output the camera shake signal, wherein, upon settingthe movable range, in a case where the distance to a subject is lessthan or equal to a predetermined threshold value, the movable range isset so as to continuously become narrower as the distance to a subjectbecomes shorter.